package ${packageName}.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import ${packageName}.mapper.${upperDataKey}Mapper;
import ${packageName}.common.ErrorCode;
import ${packageName}.constant.CommonConstant;
import ${packageName}.exception.ThrowUtils;
import ${packageName}.mapper.${upperDataKey}Mapper;
import ${packageName}.model.dto.${dataKey}.${upperDataKey}QueryRequest;
import ${packageName}.model.entity.${upperDataKey};
import ${packageName}.model.entity.${upperDataKey}Favour;
import ${packageName}.model.entity.${upperDataKey}Thumb;
import ${packageName}.model.entity.User;
import ${packageName}.model.vo.${upperDataKey}VO;
import ${packageName}.model.vo.UserVO;
import ${packageName}.service.${upperDataKey}Service;
import ${packageName}.service.UserService;
import ${packageName}.utils.SqlUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
* ${dataName}服务实现
*
*/
@Service
@Slf4j
public class ${upperDataKey}ServiceImpl extends ServiceImpl<${upperDataKey}Mapper, ${upperDataKey}> implements ${upperDataKey}Service {


    @Resource
    private ${upperDataKey}Mapper ${dataKey}Mapper;


    /**
    * 根据ID获取${dataName}
    *
    * @param ${dataKey}
    * @param request
    * @return
    */
    @Override
    public ${upperDataKey}VO get${upperDataKey}VO(Long id) {
        ${upperDataKey}VO ${dataKey}Vo = ${dataKey}Mapper.select${dataKey}ById(id);
        return ${dataKey}Vo;
    }

    /**
    * 分页获取${dataName}封装
    *
    * @param ${dataKey}Page
    * @param request
    * @return
    */
    @Override
    public PageInfo<${upperDataKey}VO> getCodeVOPage(${upperDataKey}QueryRequest ${dataKey}QueryRequest) {
        PageHelper.startPage(${upperDataKey}QueryRequest.getCurrent(), ${dataKey}QueryRequest.getPageSize());
        List<${upperDataKey}VO> ${dataKey}VOS = ${dataKey}Mapper.select${upperDataKey}ListByCondition(${dataKey}QueryRequest);
        return new PageInfo<${upperDataKey}VO>(${dataKey}VOS);
    }


}